<p>
    <a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'term', 'action' => 'add')) ?>"
       class="button" title="Novo Termo" accesskey="N">
        <img src="<?php echo $this->baseUrl() ?>/images/mini/add.png" border="0" alt="" />
        Novo Termo</a>
</p>

<?php if(count($this->terms)>0): ?>
    <table>
    <thead>
        <tr>
            <td>Termo</td>
            <?php
            // TODO: Engadir máis campos á grella
            ?>
            <td colspan="2">&nbsp;</td>
        </tr>
    </thead>
    <tbody>
    <?php foreach($this->terms as $term): ?>
    <tr>
        <td><?php echo $this->escape($term->name) ?></td>        
        
        <td class="button">
            <a href="<?php echo $this->url(array('module' => 'admin',
                                                 'controller' => 'term',
                                                 'action' => 'edit',
                                                 'id' => $term->id)) ?>">
                <img src="<?php echo $this->baseUrl() ?>/images/mini/edit.png" border="0" alt="" /></a>
        </td>
        <td class="button last">
            <a href="<?php echo $this->url(array('module' => 'admin',
                                                 'controller' => 'term',
                                                 'action' => 'delete',
                                                 'id' => $term->id)) ?>">
                <img src="<?php echo $this->baseUrl() ?>/images/mini/delete.png" border="0" alt="" /></a>
        </td>
    </tr>
    <?php endforeach; ?>
    </tbody>
    </table>
    
    <?php echo $this->paginationControl($this->terms,
                         'Sliding', 'pagination.phtml'); ?>
    
<?php else: ?>    
    <h2>Sen termos no sistema.</h2>
<?php endif; ?>